package com.lyn.solitude_plugin_api.plugin;

import android.app.Application;
import android.content.Context;
import android.content.Intent;
import android.content.res.AssetManager;
import android.content.res.Resources;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.Window;

import androidx.annotation.ColorRes;
import androidx.annotation.DrawableRes;
import androidx.annotation.IdRes;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.StringRes;
import androidx.appcompat.app.ActionBar;
import androidx.appcompat.app.AppCompatActivity;
import androidx.fragment.app.FragmentManager;
import androidx.lifecycle.Lifecycle;

import com.lyn.solitude_aidl_host.PluginHostAidlInterface;
import com.lyn.solitude_plugin_api.entity.Plugin;


/**
 * 插件activity 生命周期
 *
 * @author longyn 2024/4/14
 * @version 1.0.0
 */
public interface PluginActivityLifecycle {


    void onPlugin(Plugin plugin);

    Plugin getPlugin();

    void onPluginHostAidlInterfaceStub(PluginHostAidlInterface.Stub stub);

    PluginHostAidlInterface.Stub getPluginHostAidlInterfaceStub();

    AppCompatActivity getActivity();

    Context getContext();

    void onActivity(AppCompatActivity activity);

    void onCreate(@Nullable Bundle savedInstanceState);

    void setContentView(int layoutId);

    void setContentView(View contentView);

    Intent getIntent();

    AssetManager getAssets();

    ClassLoader getClassLoader();

    Resources getResources();

    String getString(@StringRes int resId);

    int getColor(@ColorRes int resId);

    Drawable getDrawable(@DrawableRes int redId);

    LayoutInflater getLayoutInflater();

    boolean onOptionsItemSelected(@NonNull MenuItem item);

    boolean onMenuOpened(int featureId, @NonNull Menu menu);

    void onNewIntent(Intent intent);

    void onRestart();

    void onStart();

    void onResume();

    void onPause();

    void onDestroy();

    void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions,
                                    @NonNull int[] grantResults);

    void onActivityResult(int requestCode, int resultCode, Intent data);

    boolean isNotBackPressed();

    void onBackPressed();

    android.app.FragmentManager getFragmentManager();

    FragmentManager getSupportFragmentManager();

    Application getApplication();

    void startPluginActivity(Class<? extends PluginActivityLifecycle> pluginClass);

    void startActivity(Intent intent);

    void startActivity(Intent intent, Bundle options);

    void startActivityForResult(Intent intent, int requestCode);

    void startActivityForResult(Intent intent, int requestCode, Bundle options);

    void onOriginalResources(Resources resources);

    Resources getOriginalResources();

    ActionBar getSupportActionBar();

    void finish();

    <T extends View> T findViewById(@IdRes int id);

    Window getWindow();

    <T> T getSystemService(Class<T> serviceClass);

    Object getSystemService(String name);

    MenuInflater getMenuInflater();

    Lifecycle getLifecycle();
}